package file;

import java.io.File;

public class ListFilesDemo {
    public static void main(String[] args) {

        File dir = new File("src/main/java/file");
        if (dir.isDirectory()){
            System.out.println(dir.getName()+"：是一个目录");
        }
        File[] subs = dir.listFiles();
        System.out.println(subs.length+"个子项目");
        for (File sub:subs){
            System.out.println(sub.getName());
        }
    }
}
